import request from '@/utils/request'

export function fetchDataSource (query) {
  return request({
    url: '/dataSource/getDataSourceNames',
    method: 'get',
    params: query
  })
}

export function fetchList (query) {
  return request({
    url: '/dataSource/page',
    method: 'get',
    params: query
  })
}

export function addObj (obj) {
  return request({
    url: '/dataSource/add',
    method: 'post',
    data: obj
  })
}

export function updateObj (obj) {
  return request({
    url: '/dataSource/update',
    method: 'post',
    data: obj
  })
}

export function getObj (id) {
  return request({
    url: '/dataSource/' + id,
    method: 'get'
  })
}

export function delObj (row) {
  return request({
    url: '/dataSource/delete/' + row.name ,
    method: 'delete'
  })
}


